package araujoCoronelVillamayor.plantasVsZombies.domain

import java.io.Serializable

class FactoryPlantas implements Serializable {
	static int plantaNumero
	static FactoryPlantas factoryPlantasUnica
	
	private new(){
		plantaNumero = 0
	}
	
	def static FactoryPlantas getInstance() {
		if (factoryPlantasUnica == null) {
			factoryPlantasUnica = new FactoryPlantas()
		}
		factoryPlantasUnica
	}
	
	def Planta crearShooter(){
		this.incrementarPlantaNumero
		new Planta("Planta Shooter (#" + plantaNumero + ")", 4, 2, "Acuatica")
	}
	
	def Planta crearGirasol(){
		this.incrementarPlantaNumero
		new Planta("Planta Girasol (#" + plantaNumero + ")", 1, 5, "Terrestre")
	}
	
	def Planta crearPirana(){
		this.incrementarPlantaNumero
		new Planta("Planta Pirana (#" + plantaNumero + ")", 5, 1, "Terrestre")
	}
	
	def incrementarPlantaNumero(){
		plantaNumero = plantaNumero + 1		
	}
}